package engine.newUi
{
	import engine.control.ControlCreater;
	import engine.data.BindManage;
	import engine.data.ModelLocator;
	import engine.data.ResPath;
	import engine.data.RoleVo;
	import engine.flag.GameDefine;
	import engine.flag.PlayerActionFlag;
	import engine.flag.ResourcesPath;
	import engine.logic.McPool;
	import engine.net.datatype.WString;
	import engine.net.event.CustomMsgEvent;
	import engine.net.messages.CustomToClientFlag;
	import engine.net.messages.CustomToServerFlag;
	import engine.net.mgr.SystemSender;
	import engine.tip.TipsMainLogic;
	import engine.tip.tipItem.EquipItem;
	import engine.tip.tipItem.KungfuItem;
	import engine.tip.tipItem.LookOverEquipItem;
	import engine.tip.tipItem.PetTipItem;
	
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.filters.GlowFilter;
	import flash.net.FileFilter;
	import flash.text.TextField;
	import flash.utils.getTimer;
	
	import newx.com.ResManager;
	import newx.com.config.StaticIni;
	import newx.com.control.NxClip;
	import newx.com.control.comboBox.NxComboBoxEvent;
	import newx.com.control.window.NxWindowEvent;
	import newx.utils.FilterUtil;
	import newx.utils.MemoryOptimise;

	/**
	 *查看别人的人物属性 
	 * @author yanghr
	 * 
	 */	
	public class ActorPropertyLogic
	{
		private  var _ui:ActorPropertyUI;
		private static var _self:ActorPropertyLogic;
		public static function getInstance():ActorPropertyLogic
		{
			if(_self==null)
			{
				_self=new ActorPropertyLogic();
			}
			return _self;
		}
		/**
		 *装备数量 
		 */		
		private const MAX_EQ:int=8
		private var _eqCellArr:Array;
		private var _bind:BindManage;
		private var _model:ModelLocator;
		private var _role:RoleVo;
		/**
		 *属性名 
		 */		
		private const DATA:String="data";
		private const IS_FULL_DATA:String="isfullData";
		private const EQ_ARR:String="equip_Array"
		private const INDEX:String="index";
		private const EQUIP:String="item";
		private const TXT:String="titleTxt2";
		private const LVL:String="infoTxt5";
		private const BIND:String="bind";
		
		private const MC_NAME:String="name_";
		private const MC_CONFIG:String="config_";
		
		private const CONFIGID:String="ConfigID";
		/**
		 *xml属性名 
		 */		
		private const PLAYER:String	=	"player",
						PLAYER_PROPERTY:String="Property",
						PARTNER:String	=	"PartnerBox",
						PLAYER_EQUIP:String=	"EquipBox",
						PARTNER_ITEM:String	=	"Partner",
						PARTNER_PROPERTY:String="Properties",
						PARTNER_EQUIP:String="PartnerEquip",
						OBJECT:String="Object ",
						PROPERTISE:String=	"Properties",
						ITEM:String="Item";
		private var _currentSelectedM:MovieClip;

		private var _tip:TipsMainLogic;
		private var _maxLife:int;
		private var _nowLife:int;
		private var _skill:int;
		private var _gang:int=-1;
		private var _outWork:int	=	-1;
		private var _staWork:int	=	-1;
		private var _interWork:int	=	-1;
		private var _lvl:String	=	" ";
		private var _reputation:int	=	-1;
		private var _figthCount:int	=	-1;
		private var _name:String;
		private var _maxExp:Number;
		private var _exp:Number;
		private var _actorObj:Object;
		
		private var _needreFreshList:Boolean=false
		
		
		private var _roleName:String;
		private var _eqItem:LookOverEquipItem;
		private var _allList:Array;
		private var _allInfo:XML
		private var _playerInfoXML:XMLList;
		private var callBack:Function;
		private var plist:Array;
		/**
		 *人物属性 
		 */		
//		private var _propertise:XMLList;
		/**
		 *伙伴 
		 */		
		private var _partnerList:XMLList;
		
		/**
		 *技能 
		 */		
		private var _skillList:XMLList;
		
		private var _nowList:XML;
		private var _text:TextField=new TextField;
		private var _kungfuItem:KungfuItem;
		
		private var _isReadyAll:Boolean	=	false;
		
		//存放遮罩的数组
		private var _veilArr:Array=[];
		
		private var _petTipItem:PetTipItem;
		/**洗髓属性名**/
		private var _xisuiProName:Array;
		public function ActorPropertyLogic()
		{
			if(_ui==null)
			{
				_ui=new ActorPropertyUI(this)
			}
		}
		
		public function BeforeShow():void
		{
			_ui.veilBtn.visible = false;
//			addAllListener();
			for each (var i:NxClip in _eqCellArr) 
			{
				(i.content as MovieClip).gotoAndStop(1);
				var nxx:NxClip=i.data.GetProperties(EQUIP);
				if(!nxx.parent&& i.content["img01"] != null)
				{
					i.content["img01"].addChild(nxx);
				}
			}
			addAllListener();
			refreshKungfu();
//			refreshPet();
			_ui.detailLab.visible=_ui.actorVisual.buttonMode=_ui.actorVisual.mouseChildren=_ui.actorVisual.mouseEnabled=_role.getPlayerLevel()>=int(StaticIni.getIniObj("MyPropertyUI_LVL")["details"]);
//			refreshUI()
		}
		
		public function Init():void
		{
			_petTipItem = new PetTipItem();
			_ui.skillComb.visible	=	false;
			_ui.expBar.visible=false;
			_ui.expTxT.visible=false;
			_ui.chengskillBtn.visible=false;
			_ui.battleBtn.visible=false;
			_ui.skill_lab.visible	=	true
			_ui.xisuiMc.visible = false;
			_ui.developBtn.visible	=	ui.medicineBtn.visible	=	ui.partnerBtn.visible	=	false;
			ui.windowBG.addEventListener(NxWindowEvent.WINDOW_CLOSE,close)
			_eqCellArr=[];
			_kungfuItem=new KungfuItem
			var len:int=ui.actorGroup.col*ui.actorGroup.row
			_bind=BindManage.getInstance();
			_model=ModelLocator.getInstance();
			_role=_model.scene.Role;
			_tip=TipsMainLogic.instance;
			_currentSelectedM=ui.actorGroup.getItemByIndex(0);
			_eqItem=new LookOverEquipItem();
			_currentSelectedM.gotoAndStop(3);
			//装备
			for (var i:int	=	1; i <=	MAX_EQ; i++) 
			{
				var targetStr:String="eq"+i;
				var nx:NxClip	=	ui[targetStr];
				var	contentArr:Object	=	StaticIni.getIniObj("ActorPropertyUI"+"_"+targetStr);
				nx.source=contentArr["source"]//"Picturebox_4";
				nx.addEventListener(MouseEvent.ROLL_OVER,rollOver);
				nx.addEventListener(MouseEvent.ROLL_OUT,rollOut);
//				nx.addEventListener(MouseEvent.CLICK,clickIt);
				nx.content['up'].visible=false;
				(nx.content as MovieClip).gotoAndStop(1);
				//				trace("i.content['up'].visible=",nx.content["up"].visible);
				//				trace("MyPropertyLogic.Init()",nx.defaultImage,nx.defaultImage.visible,nx.defaultImage.parent);
				//				nx.data=
				_eqCellArr.push(nx);
				nx.data.HandleProperties(INDEX,i);
				//物品
				var nxx:NxClip	=	new NxClip;
				nxx.mouseChildren=nxx.mouseEnabled	=	false;
				nx.data.HandleProperties(EQUIP,nxx);
				
			}
			_veilArr =["custSkin_45","custSkin_46","custSkin_47","custSkin_48","custSkin_49"];
//			_model.addEventListener( String(CustomToClientFlag.SERVER_CUSTOMMSG_SEND_CLONE_PLAYER_CHALLENGE_TOP), getTop );
			_model.addEventListener(String(CustomToClientFlag.SERVER_CUSTOMMSG_ROLE_EQUIPS_INFO),lookPlayer);
//			_model.addEventListener( String(CustomToClientFlag.SERVER_CUSTOMMSG_SEND_CLONE_PLAYER_CHALLENGE_TOP), getTop );
		}
		/**
		 *查看好友 
		 * @param name
		 * @param callBack(收到服务器消息后界面打开的 回调函数)
		 * @param plist 回调函数参数
		 * 
		 */		
		public function lookOver(name:String,callBack:Function=null,plist:Array=null):void
		{
//			if(!showCondition())return 
			this.callBack=callBack;
			this.plist=plist;
			var st:WString=new WString(name);
			SystemSender.getInstance().CustomMsg(CustomToServerFlag.CLIENT_CUSTOMMSG_LOOK_EQUIPS,st,0)
//			SystemSender.getInstance().CustomMsg(CustomToServerFlag.CLIENT_CUSTOMMSG_GET_CLONE_PLAYER_CHALLENGE_TOP,st);
		}
		/**
		 *查看伙伴 
		 * @param partnerConfigID
		 * @param roleName
		 * 
		 */		
		public function lookOverPartner(partnerConfigID:int,roleName:String=""):void
		{
//			if(!showCondition())return 
				roleName||=this.roleName
				var st:WString=new WString(roleName);
//				trace("ActorPropertyLogic.lookOverPartner(partnerConfigID, roleName)",partnerConfigID,roleName);
				SystemSender.getInstance().CustomMsg(CustomToServerFlag.CLIENT_CUSTOMMSG_LOOK_EQUIPS,st,partnerConfigID)
		}
		private function showCondition():Boolean
		{
			if(!_model.GetProperties("debug"))
			{
				NoticeUI.getInstance().showInfo(StaticIni.getSwfLangStr("Common_Unavailable"));
				return false;
			}
			else
			{
				return	true 
			}
		}
		/**
		 *window title	&	竞技场排名 
		 * @param evt
		 * 
		 */		
		private function getTop( evt : CustomMsgEvent ):void
		{
			//排名竞技场排名
			//			lab_rolerank.htmlStr	= StaticIni.getSwfLangStrVar( "UIStr_1001777", 
			//				[ evt.pList[1] < 1 ? StaticIni.getSwfLangStr( "Common_Null" ) : evt.pList[1] ] );
			
			//等级，姓名，种族，职业
			var name 	: String 	= _roleName//_role.getPlayerName();
			if(evt.pList[0]!=_roleName)return ;
			var nation 	: String	= getPropertyList(_playerInfoXML[0],"GuildName")//StaticIni.getSwfLangStr( "Nation_" + _role.getPlayNation() );
			var prof 	: String	= StaticIni.getSwfLangStr( "Profession_" + _role.getPlayerProf() );
			var ranl	:String		=	evt.pList[1] < 1 ? StaticIni.getSwfLangStr( "Common_Null" ) : evt.pList[1] ;
//				StaticIni.getSwfLangStrVar( "UIStr_1001777", 
//				[ evt.pList[1] < 1 ? StaticIni.getSwfLangStr( "Common_Null" ) : evt.pList[1] ] )
			ui.windowBG.title = StaticIni.getSwfLangStrVar( "UIString_1000020", [ _roleName, nation, ranl ] );
			
			//			SystemSender.getInstance().CustomMsg( CustomToServerFlag.CLIENT_CUSTOMMSG_GET_CLONE_PLAYER_CHALLENGE_TOP, new WString(_role.getPlayerName()) );
		}
		/**
		 *装备Tips 
		 * @param e
		 * 
		 */		
		private function rollOver(e:Event):void
		{
			var nx:NxClip	=	e.target as NxClip;
			var dataobj:Object	=	nx.data.GetProperties(DATA)
			var item:NxClip	=	e.currentTarget as NxClip;
			(item.content as MovieClip).gotoAndStop(2)
			if(dataobj!=null)
			{
				dataobj[EquipItem.CURRENT_LEVEL]=getPropertyFromNowList(ActorPropertyUI.LEVEL);
//				TipsMainLogic.instance.showMain(dataobj,false);
				_eqItem.data=dataobj
				TipsMainLogic.instance.showByItem(_eqItem);
				delete dataobj[EquipItem.CURRENT_LEVEL];
			}
			else
			{
				TipsMainLogic.instance.showMain(StaticIni.getSwfLangStr("EquipStr_"+nx.data.GetProperties(INDEX)));
			}
		}
		private function rollOut(e:Event):void
		{
			var nx:NxClip	=	e.target as NxClip;
			(e.currentTarget.content as MovieClip).gotoAndStop(1);
			TipsMainLogic.instance.hide();
		}
		/**
		 *主角名 
		 * @return 
		 * 
		 */		
		public function get roleName():String
		{
			return _roleName;
		}
		/**
		 *当前人物名 
		 * @return 
		 * 
		 */		
		public function get currentName():String
		{
			return actorName;
		}
		public function get currentSelectedM():MovieClip
		{
			return _currentSelectedM;
		}
		
		public function set currentSelectedM(value:MovieClip):void
		{
			if(_currentSelectedM&&_currentSelectedM==value)
			{
//				return 
				//				_currentSelectedM.filters=null;
			}
			_currentSelectedM.gotoAndStop(1)
			_currentSelectedM = value;
			if(_currentSelectedM)
			{
				_currentSelectedM.gotoAndStop(3)
				_nowList=_currentSelectedM[DATA];
				if(DetailsOtherPropertyLogic.getInstance().ui.created)
				{
//					clickClip(null);
					DetailsOtherPropertyLogic.getInstance().showProperty(_nowList);
				}
				refreshUI();
				refreshKungfu();
				refreshPet();
//				refreshPet();
				//				_currentSelectedM.filters=[new GlowFilter()]
			}
		}
	
		public function addAllListener():void
		{
			ui.actorGroup.addEventListener(MouseEvent.CLICK,actorClickHandle,true);
			ui.actorVisual.addEventListener(MouseEvent.CLICK,clickClip)
			ui.detailLab.addEventListener(MouseEvent.CLICK,clickClip)
//			ui.actorGroup.addItemsEvent(MouseEvent.ROLL_OVER,grouprollOver);
			ui.windowBG.addEventListener(MouseEvent.MOUSE_OVER,labelTipsHandle);
			ui.actorGroup.addItemsEvent(MouseEvent.ROLL_OVER,grouprollOver)
			ui.actorGroup.addItemsEvent(MouseEvent.ROLL_OUT,grouprollOut)
		}
		private function clickClip(e:Event):void
		{
			DetailsOtherPropertyLogic.getInstance().ui.showOrHide();
			DetailsOtherPropertyLogic.getInstance().showProperty(_nowList);
		}
//		private function grouprollOver(e:Event):void
//		{
//			var mc:MovieClip=e.currentTarget as MovieClip;
//			var xml:XML=mc[DATA]//_roleArr[e.currentTarget[INDEX]];
//			var p1:String=mc[TXT].text//obj.GetPropertiesEx("ConfigID")?StaticIni.getSwfLangStr(obj.GetPropertiesEx("ConfigID")):obj.GetPropertiesEx("Name");
//			var plist:Array=[p1,getPropertyList(xml,getExpName(mc[INDEX])),getPropertyList(xml,getMaxExpName(mc[INDEX]))]
//				//obj.GetPropertiesEx(getMaxExpName(mc[INDEX]));
//			_tip.showString(StaticIni.getSwfLangStrVar("UIString_1000037",plist))
//		}
		private function close(e:Event):void
		{
			ui.showOrHide();
		}
		public function removeAllListener():void
		{
			ui.actorGroup.removeEventListener(MouseEvent.CLICK,actorClickHandle,true);
//			ui.skillComb.removeEventListener(NxComboBoxEvent.NXCOMBOBOX_CLICK,skillClick);
			ui.actorGroup.removeItemsEvent(MouseEvent.ROLL_OVER,grouprollOver)
			ui.actorGroup.removeItemsEvent(MouseEvent.ROLL_OUT,grouprollOut)
		}
		/**
		 *	Tip回调 
		 * @param e
		 * 
		 */		
		private function labelTipsHandle(e:Event):void
		{
			var  str:String="";
//			var obj:ObjectData=_roleArr[currentSelectedM[INDEX]]
			var xml:XML	=	currentSelectedM[DATA];
			var plist:Array;
			var glow:GlowFilter		= new GlowFilter();
			glow.color 				= 0xFFFFFF;
			switch(e.target)
			{
				//主角图像
				case ui.actorVisual:
				{
					str	=	"UIString_1000035"
					break;
				}
				case ui.developBtn:
				{
					break;
				}
				case ui.gangTxT:
				{
					break;
				}
				case ui.interWorkTxT:
				{
					str	=	"UIString_1000033"
					break;
				}
				case ui.outWorkTxT:
				{
					str	=	"UIString_1000032"
					break;
				}
				case ui.sta_lab:
				{
					str	=	"UIString_1000034"
					break;
				}
				case ui.lifeTxT:
				{
					break
				}
				case ui.lvlTxT:
				{
					break;
				}
				case ui.medicineBtn:
				{
					break;
				}
				case ui.nameTxT:
				{
					break;	
				}
				case ui.partnerBtn:
				{
					break;
				}
				case ui.reputationTxT:
				{
					str	=	"UIString_1000036";
					plist=[getPropertyList(_playerInfoXML[0],ActorPropertyUI.PARTNER_INVITE)]
					break;
				}
				case ui.fightCountTxT:
				{
					str	=	"UIString_1000735";
					plist = [ _figthCount,int( _model.scene.Role.GetProperties("FightPetPower"))] ; 
					break ; 
				}
				case ui.kungfuMc:
				{
//					var view:View=_model.scene.GetView(getKungfuViewID());
					var kungfuList:XML=_nowList;
					if(!String(kungfuList))return;
					ui.kungfuMc["gotoAndStop"](2);
					var arr:Array=getArr("KungFuBox");
					for each (var i:Object in arr) 
					{
						var obb:Object=StaticIni.getIniObj(i[CONFIGID]);
						for  (var j:String in obb) 
						{
							if(!i.hasOwnProperty(j))
							{
								i[j]=obb[j];
							}
						}
						
					}
					arr.sort(
						function compare(v1:Object,v2:Object):int
						{
							if(v1["KungFuQuality"]==v2["KungFuQuality"])
							{
								return v2["KungFuLevel"]-v1["KungFuLevel"]
							}
							else
							{
								return v2["KungFuQuality"]-v1["KungFuQuality"]
							}
						}
					)
					for each (var val:Object in arr) 
					{
						_kungfuItem.data=val;
						str+=_kungfuItem.getLittleStr()+"\n";
					}
					//					str=str.slice(0,str.length-1);
					if(str)
						_tip.showWideString(str);
					return ;
				}
				case ui.petMc:
				{
					//					var view:View=_model.scene.GetView(getKungfuViewID());
					ui.petMc.filters = [glow];
					var _arr:Array = new Array();
					_arr.push(getPropertyFromNowList("FightPet"));
					_arr.push(getPropertyFromNowList("FightPetName"));
					_arr.push(getPropertyFromNowList("FightPetGrade"));
					_arr.push(getPropertyFromNowList("FightPetLevel"));
					_arr.push(getPropertyFromNowList("FightPetPropLevel"));
					_arr.push(getPropertyFromNowList("FightPetPower"));
//					ui.petMc["gotoAndStop"](2);
					str = _petTipItem.getPetTips(_arr);
					_tip.showString(str);
					return ;
				}
				case ui.xisuiMc:
				{
					ui.xisuiMc.filters		= [glow];
					_xisuiProName = [];
					var xisuiArr:Array = dealxisuiData("WashPulpBaseRec");
					var precent:Object=StaticIni.getIniObj("PercentMap");
					str += StaticIni.getSwfLangStr("RandomPropertyTips_32") + "\n";
					for(var _num:int = 0; _num < xisuiArr.length; _num++){
						var value:* = (precent.hasOwnProperty(xisuiArr[_num]["PropName"])) ? Number(xisuiArr[_num]["Value"]).toFixed(2) : int(xisuiArr[_num]["Value"]);
						var _addstr:String = (_num == xisuiArr.length - 1) ? "" : "\n";
						var soucre:String = StaticIni.getSwfLangStrVar("Item_" + xisuiArr[_num]["PropName"], [value]) + _addstr;
						str += _tip.getColorHtml(soucre , "ff8000");
					}
					
					_tip.showString(str);
					return;
				}
				default:
				{
					ui.kungfuMc["gotoAndStop"](1);
					ui.xisuiMc.filters		= [];
					ui.xisuiMc.buttonMode	= false;
					ui.petMc.filters 		= [];
//					ui.petMc["gotoAndStop"](1);
					if(ui.expBar.contains(e.target as DisplayObject)||ui.expTxT.contains(e.target as DisplayObject))
					{
						var exp:int=int(getPropertyList(xml,getExpName(currentSelectedM[INDEX])))*100;
						var mxexp:int=int(getPropertyList(xml,getMaxExpName(currentSelectedM[INDEX])))
						//GameDefine.GET_MAXHP(getPropertyList(xml,"Sta"))
						if(maxExp)
						{
							_tip.showString(
								(Math.min(exp/mxexp,100)).toFixed(2)+"%"
							)
						}
						else
						{
							_tip.showString(
								"0%"
							)
						}
						return;
					}
					else if(ui.skillComb.contains(e.target as DisplayObject)||ui.skill_lab.contains(e.target as DisplayObject))
					{
						str	=	"SkillDes_"+getPropertyList(xml,"DefaultUltraSkill")//+skillId
					}
					else if(ui.detailLab.contains(e.target as DisplayObject))
					{
						str	=	"UIString_1000035"
					}
					else if(ui.actorGroup.contains(e.target as DisplayObject))
					{
						//						grouprollOver(e);
						return ;
					}
					else if(_eqCellArr.some(eachItem))
					{
						return ;
					}
				}
			}
			if(str)
				_tip.showString(StaticIni.getSwfLangStrVar(str,plist))
			else
				_tip.hide();
			function eachItem(item:NxClip,index:int,arr:*):Boolean{
				return item.contains(e.target as DisplayObject)
			}
		}
		public function afterhide():void
		{
			removeAllListener();
			_roleName="";
			_playerInfoXML=null;
			_needreFreshList=true;
			ui.kungfuMc["gotoAndStop"](1);
			ui.xisuiMc.filters		= [];
			ui.xisuiMc.buttonMode	= false;
			ui.petMc.filters 		= [];
		}
		
		/**
		 *处理洗髓xml 
		 * @param eqName
		 * 
		 */		
		private function dealxisuiData(eqName:String):Array
		{
			var eqList:XMLList;
			var arr:Array	= [];
			eqList	=	_nowList.elements(eqName);
			var proName:String;
			for each (var i:XML in eqList.elements()) 
			{
				var obj:Object=new Object();
				for each (var j:XML in i.elements()) 
				{
					proName			= getxisuiList(j, "ColName");
					obj[proName]	= getxisuiList(j, "ColValue");
				}
				arr.push(obj);
			}
			for(var z:int = 0; z < arr.length; z++){
				var index:int = _xisuiProName.indexOf(arr[z]["PropName"]);
				if(index == -1){
					_xisuiProName.push(arr[z]["PropName"]);
				} else {
					var _value:Number = Number(arr[index]["Value"]);
					arr[index]["Value"] = _value + Number(arr[z]["Value"]);
					arr.splice(z, 1);
				}
			}
			return arr;
		}
		
		private function getxisuiList(xml:XML,propertyName:String):String
		{
			var value:String	= xml.elements("Col").attribute(propertyName);
			if(!value)
			{
				value	= xml.attribute(propertyName);
			}
			if(!value)
			{
				return null;
			}
			return value;
		}
		
		/**
		 * 查看玩家
		 * 
		 * 
		 * */
		private function lookPlayer(e:CustomMsgEvent):void
		{
//			removeEquipEffects();
			_xisuiProName = [];
			_allList = e.pList;
//			trace("ActorPropertyLogic.lookPlayer(e)",e.pList);
			var xmlll:XML=new XML(_allList[1]);
			var refresh:Boolean=_allList[2];
			var tempConfigId:int=xmlll.elements(PARTNER_ITEM).attribute("ConfigID");
			
			if(_roleName 	==	 _allList[0]	&&	tempConfigId)
			{
				_needreFreshList=false
				var mc:MovieClip=_actorObj[tempConfigId];
				mc[DATA]=xmlll.elements(PARTNER_ITEM)[0];
				mc[IS_FULL_DATA]=true;
				if(!refresh)
					currentSelectedM=mc;
				
			}
			else
			{
				removeAllListener();
				_roleName=_allList[0]
				_actorObj=new Object;
			
				_allInfo = new XML(_allList[1]);
				
				
				_playerInfoXML=_allInfo.elements(PLAYER);
				
				_partnerList	=	_allInfo.elements(PLAYER)[0].elements(PARTNER);
				
	//			_propertise		=	_playerInfoXML.elements("Properties")	
				_skillList	=	_playerInfoXML.elements("LifeSkillContainer");
				refreshUnChange()
				currentSelectedM	=	ui.actorGroup.getItemByIndex(0);
				if(!ui.created)
					ui.showOrHide();
				if(callBack!=null)
				{
					callBack.apply(this,plist)
				}
			}
			//判断洗髓图标是否显示
			var _xmllist:XMLList = _nowList.elements("WashPulpBaseRec");
			if(_xmllist.children().length() == 0){
				ui.xisuiMc.visible = false;
			} else {
				ui.xisuiMc.visible = true;
			}
			
			//判断宠物图标是否显示
			var str:String = getPropertyFromNowList("FightPet");
			if(str==null ||str =="0"){
				ui.petMc.visible = false;
			} else {
				ui.petMc.visible = true;
			}

//			setCastleDetails();
		}
		private function setRoleEuqePos():void
		{
			_ui.eq7.visible = _ui.eq8.visible = true;
			_ui.eq1.y =_ui.eq4.y = 65;
			_ui.eq2.y =_ui.eq5.y = 114;
			_ui.eq3.y =_ui.eq6.y = 164;
			
		}
		private function setParentEuqePos():void
		{
			_ui.eq7.visible = _ui.eq8.visible = false;
			_ui.eq1.y =_ui.eq4.y = 77;
			_ui.eq2.y =_ui.eq5.y = 139;
			_ui.eq3.y =_ui.eq6.y = 200;
		}
		private function refreshUnChange():void
		{
//			showTop();
			refreshList(_playerInfoXML[0],0);
		}
		private function refreshKungfu():void
		{
			var arr:Array=getArr("KungFuBox");
			_ui.kungfuMc.visible=arr&&arr.length;
		}
//		private function refreshPet():void
//		{
//			
//		}
		private function refreshPet():void
		{
			var str:String = getPropertyFromNowList("FightPet");
			if(str==null ||str =="0"){
				ui.petMc.visible = false;
			} else {
				ui.petMc.visible = true;
			}
		}
		private function refreshUI():void
		{
			showPlayerPhoto();
			showPlayerInfo();
//			showSkill();
			showEquip();
		}
		private function get photoMc():MovieClip
		{
			return ui.photoMc;
		}
		private function get rolePhoto():NxClip
		{
			return ui.actorVisual;
		}
		private function showPlayerPhoto():void
		{
			photo	=getPropertyFromNowList("Model")// updata(_nowList,["Model"])
		}
		private function getPropertyFromNowList(propertyName:String):String
		{
			return getPropertyList(_nowList,propertyName)
		}
		private function getPropertyList(xml:XML,propertyName:String):String
		{
			var value:String=xml.elements(PLAYER_PROPERTY).attribute(propertyName);
//			if(xml.name()==PLAYER)
//			{
//				value= xml.elements(PLAYER_PROPERTY).attribute(propertyName)
//			}
//			else if(xml.name()		== PARTNER_ITEM)
//			{
//				value= xml.elements(PARTNER_PROPERTY).attribute(propertyName);
//			}
			if(!value)
			{
				value=xml.attribute(propertyName);
			}
			if(!value)
			{
//				trace("Error!~ActorPropertyLogic.getPropertyFromNowList(propertyName)",_nowList.name(),propertyName);
				return null;
			}
			return value;
		}
		private function getExpName(index:int):String
		{
			if(index!=0)
			{
				return "PartnerExp"
			}
			else
			{
				return ActorPropertyUI.CUR_EXP;
			}
		}
		private function getMaxExpName(index:int):String
		{
			if(index!=0)
			{
				return "PartnerUpgradeExp"
			}
			else
			{
				return ActorPropertyUI.CUR_MAX_EXP;
			}
		}
		private function showPlayerInfo():void
		{
			if(_nowList.name()==PARTNER_ITEM)
			{
				actorName=StaticIni.getSwfLangStr(getPropertyFromNowList("ConfigID"));
			}
			lvl =getPropertyFromNowList(ActorPropertyUI.LEVEL);
			//显示战斗力
			figthCount	=	int(getPropertyList(_playerInfoXML[0],ActorPropertyUI.TOTAL_FIGHT_POWER));//int(getPropertyList(_playerInfoXML[0],ActorPropertyUI.FIGHT_POWER));
			skillid	=int(getPropertyFromNowList(ActorPropertyUI.SKILL_ID));
//			exp=	int(getPropertyFromNowList(getExpName(currentSelectedM[INDEX])));
//			maxExp	=	int(getPropertyFromNowList(getMaxExpName(currentSelectedM[INDEX])));
//			nowLife	=	int(getPropertyFromNowList(ActorPropertyUI.HP));
			//
//			DetailPropertyLogic.getInstance().setData(_nowList);
			maxLife	=	int(getPropertyFromNowList(ActorPropertyUI.MAX_HP))//int(DetailPropertyLogic.getInstance().maxlife)
			staWork	=	int(getPropertyFromNowList(ActorPropertyUI.STA_WORK))//+int(_nowList.@StaAdd) int(DetailPropertyLogic.getInstance().sta)
			interWork	=	int(getPropertyFromNowList(ActorPropertyUI.INTER_WORK))//+int(_nowList.@IngAdd);int(DetailPropertyLogic.getInstance().interwork)//
			outWork	=	int(getPropertyFromNowList(ActorPropertyUI.OUT_WORK))//+int(_nowList.@StrAdd);int(DetailPropertyLogic.getInstance().outwork)//
				//
			gang	=	int(getPropertyFromNowList(ActorPropertyUI.GANG));
			var name:String=StaticIni.getSwfLangStr(getPropertyFromNowList(ActorPropertyUI.CONFIG_ID));
			actorName=	name&&name!=ActorPropertyUI.CONFIG_ID?name:_roleName;
			reputation	=	_playerInfoXML.elements(PLAYER_PROPERTY).attribute(ActorPropertyUI.REPUTATION)
//			maxLife	=	GameDefine.GET_MAXHP(int(getPropertyFromNowList(ActorPropertyUI.STA_WORK)))
				
//			exp	=	_propertise.@
			
			//			var	title:String=StaticIni.getSwfLangStr("PlayerTitle_" + playerInfoXML.Properties.@Title);
			//			valTitle.htmlText = title;
		}
		private function showTop():void
		{
			var name 	: String 	= _roleName//_playerInfoXML.@Name;
			var nation 	: String	= _playerInfoXML[0].elements(PLAYER_PROPERTY).@GuildName//_role.GetPropertiesEx("GuildName")//StaticIni.getSwfLangStr( "Nation_" + _role.getPlayNation() );
			ui.windowBG.title = StaticIni.getSwfLangStrVar( "UIString_1000020", [ name,nation, 1 ] );
		}
		private function showSkill():void
		{
//			ui.skill_lab.htmlStr=_nowL("DefaultUltraSkill")
			ui.skillComb.clear();
			eachItem(_nowList.attribute("DefaultUltraSkill"),0,null)
			for each (var i:XML in _skillList.elements("Object").@ConfigID) 
			{
				eachItem(i.toString(),0,null);
			}
			function eachItem(item:int,index:int,arr:Array):void
			{
				_text.htmlText=StaticIni.getSwfLangStr(item+"")
				ui.skillComb.addItem({label:_text.text,data:item});
			}
			
		}
		private function clearAllEq():void
		{
			for each (var i:NxClip in _eqCellArr) 
			{
				removeVeil(i);
				i.data.DeleteProperties(DATA);
				var nxx:NxClip=i.data.GetProperties(EQUIP);
				nxx.clear();
				nxx.source= "";
			}
		}
		private function showEquip():void
		{
			clearAllEq();
			var eqArr:Array	=	_currentSelectedM[EQ_ARR];
			if(eqArr	==	null||	!eqArr.length)
			{
				eqArr	=	_currentSelectedM[EQ_ARR]	=	getEqObjArrFromNowList()
			}
			for each (var i:Object in eqArr) 
			{
				var obj:Object=StaticIni.getIniObj(i["ConfigID"]);
				for  (var j:String in obj) 
				{
					if(!i.hasOwnProperty(j))
					{
						i[j]=obj[j];
					}
				}
				var nx:NxClip	=	_eqCellArr[GameDefine.EQPOS_HASH_MAP[i["EquipType"]]-1];
				if(nx==null)
				{
//					trace("Error~ActorPropertyLogic.showEquip()不存在",i["ConfigID"]);
					
					continue;
				}
				var nxx:NxClip=nx.data.GetProperties(EQUIP);
				nxx.source	=	ResourcesPath.getPropsURL(i["Photo"]);
				nx.data.HandleProperties(DATA,i);
				if(nx.data.CheckProperties("date"))
				{
					removeVeil(nx);
				}
				addVeil(i,nx);
			}

			//////////
//			var leng:int = _allList.length;
//			for(var i:int = 2;i<leng;i++){
//				var equipXML:XML = new XML(_allList[i]);
//				var	 displayItem:NxClip	=	getEquipByPos(GameDefine.EQPOS_HASH_MAP[equipXML.Properties.@EquipType]);
//				displayItem.width   = 40;
//				displayItem.height  = 40;
//				
//				var	photo:String	=	equipXML.Properties.@Photo
//				displayItem.source	=	ResourcesPath.getPropsURL(equipXML.Properties.@Model)
//				displayItem.data.HandleProperties("exist",1);
//				displayItem.data.HandleProperties("data",equipXML);
				//				if(equipArr.indexOf(Obj.GetProperties("ConfigID"))==-1)
				//					equipArr.push(Obj.GetProperties("ConfigID"));
				
//				addEquipEffect(displayItem, equipXML.Properties.@Color);
		}
		/**
		 *添加遮罩 
		 * 
		 */		
		private function addVeil(ViewObj:Object,mc:NxClip):void
		{
			var color:String =ViewObj["Color"];
			var index:int =int(color)-1;
			var panle:MovieClip = McPool.borrowRes(_veilArr[index]) as MovieClip; 
			if(panle==null)
				return;
			mc.addChild(panle);
			panle.x=5
			panle.y=5
			//			panle.x=-5
			//			mc["Veil"]=panle;
			mc.data.HandleProperties("Veil",panle);
			mc.data.HandleProperties("date",ViewObj);
			//			mc["data"]=ViewObj;
		}
		/**
		 *删除遮罩 
		 * @param mc
		 * 
		 */		
		private function removeVeil(mc:NxClip):void
		{
			if(mc.data.CheckProperties("Veil"))
			{
				var url:String=mc.data.GetProperties("Veil").url;
				McPool.returnRes( url, mc.removeChild(mc.data.GetProperties("Veil")));
				mc.data.DeleteProperties("date");
				mc.data.DeleteProperties("Veil");
			}
		}
		private function getEqObjArrFromNowList():Array
		{
//			if(_nowList.name()==PLAYER)
//			{
				return getArr(PLAYER_EQUIP)
//			}
//			else if(_nowList.name()==PARTNER_ITEM)
//			{
//				return getArr(PARTNER_EQUIP)
//			}
//			else 
//			{
//				trace("Error!~ActorPropertyLogic.getEqObjArrFromNowList()",_nowList.name(),_nowList);
				
//			}
			return null
		}
		private function getArr(eqName:String):Array
		{
			var eqList:XMLList;
			var arr:Array=[];
			eqList	=	_nowList.elements(eqName);
			var proName:String;
			for each (var i:XML in eqList.elements()) 
			{
				var obj:Object=new Object();
				for each (var j:XML in i.attributes()) 
				{
					proName=j.name();
					obj[proName]=j.toString();
				}
				for each ( j in i.elements(PROPERTISE)) 
				{
					for each (var k:XML in j.attributes()) 
					{
						proName=k.name();
						obj[proName]=k.toString();
					}
				}
				arr.push(obj);
			}
			return arr;
		}
		private function getEquipByPos(index:int):NxClip
		{
			return ui["eq"+index] as NxClip;
		}
		/**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
		 *技能combox回调 
		 * @param e
		 * 
		 */		
		private function skillClick(e:NxComboBoxEvent):void
		{
			if(e.item.data == 0)
			{
//				tab_waitList.dataProvider = _FBgroupList;
			}
		}
		private function grouprollOver(e:Event):void
		{
			var mc:MovieClip=e.currentTarget as MovieClip;
			if(mc.currentFrame!=3)
			{
				mc.gotoAndStop(2)
			}
		}
		private function grouprollOut(e:Event):void
		{
			var mc:MovieClip=e.currentTarget as MovieClip;
			if(mc.currentFrame!=3)
			{
				mc.gotoAndStop(1)
			}
		}
		/**
		 *刷新伙伴列表 
		 * 
		 */		
		private function refreshList(view:XML,index:int):void
		{
			var $this:Object=this;
			var i:int	=	0;
			//重置 好友列表
			var partnerList:XMLList=_partnerList[0].elements(ITEM)
			if((partnerList.length()+1	!=	ui.actorGroup.row	||	(ui.actorGroup.getItemByIndex(ui.actorGroup.row-1)[DATA]	&&partnerList.length()+1	==	ui.actorGroup.row))||_needreFreshList)
			{
				var skin:String=ui.actorGroup.viewSkin;
				//				var col:int=ui.actorGroup.col;
				var row:int=partnerList.length()+1;
				var x:Number=ui.actorGroup.x;
				var y:Number=ui.actorGroup.y;
				var offC:Number=ui.actorGroup.offsetCol;
				var offR:Number=ui.actorGroup.offsetRow;
				var pa:DisplayObjectContainer=ui.actorGroup.parent;
				var selectIndex:int=currentSelectedM[INDEX]
				//				ui.actorGroup
//				removeAllMcBlind();
				ui.actorGroup.removeEventListener(MouseEvent.CLICK,actorClickHandle,true);
				ui.actorGroup.removeItemsEvent(MouseEvent.ROLL_OVER,grouprollOver)
				ui.actorGroup.removeItemsEvent(MouseEvent.ROLL_OUT,grouprollOut)
//				ui.actorGroup.parent.removeChild(ui.actorGroup)
				ui.actorGroup.remove();
				//创建
				ui.actorGroup=ControlCreater.getInstance().CreateNxViewGroup(row,1,skin);
				ui.actorGroup.offsetCol=offC;
				ui.actorGroup.offsetRow=offR;
				ui.actorGroup.addEventListener(MouseEvent.CLICK,actorClickHandle,true);
				ui.actorGroup.addItemsEvent(MouseEvent.ROLL_OVER,grouprollOver)
				ui.actorGroup.addItemsEvent(MouseEvent.ROLL_OUT,grouprollOut)
				ui.actorGroup.x=x;
				ui.actorGroup.y=y;
				pa.addChild(ui.actorGroup);
//				initPartnerList();
				//重新初始化列表
				setMc(_playerInfoXML[0],0);
				for (i = 0; i <partnerList.length(); i++) 
				{
					view=partnerList[i];
					setMc(view,i+1);
				}
				currentSelectedM=ui.actorGroup.getItemByIndex(Math.min(selectIndex,partnerList.length));
				return ;
			}
			setMc(view,index)
			for ( i = 0; i <partnerList.length(); i++) 
			{
				view=partnerList[i];
				setMc(view,i+1);
			}
			//				ui.actorGroup.row
			function setMc(viewXml:XML,indexxx:int):void
			{
				if(!viewXml)return ;
				var mc:MovieClip	=	ui.actorGroup.getItemByIndex(indexxx)
				var propertyname:String=viewXml.name()==PARTNER?ITEM:PLAYER_PROPERTY;
				mc[TXT].mouseEnabled	=	false;
				mc[MC_CONFIG]=String(viewXml.elements(propertyname).attribute("ConfigID"))	||	String(viewXml.attribute("ConfigID"))
				mc[TXT].text	=mc[MC_NAME]=	mc[MC_CONFIG]?StaticIni.getSwfLangStr(mc[MC_CONFIG]):_roleName;
//				if(viewObj.CheckProperties("Level")&&indexxx<=10)
				var str:String=String(viewXml.elements(propertyname).attribute("Level"))	||	viewXml.attribute("Level")
				mc[LVL].text	=	"lv."+(str&&str!="0"?str:1);
				mc[DATA]=viewXml;
				mc[IS_FULL_DATA]=false;
				mc[INDEX]	=	indexxx;
				
				_actorObj[mc[MC_CONFIG]]=mc
				
			}
		}
		/**
		 *初始化伙伴列表 
		 * 
		 */		
		private function initPartnerList():void
		{
			var len:int		=	ui.actorGroup.col*ui.actorGroup.row
			//伙伴列表
			for (var i:int = 0; i <len ; i++) 
			{
				var mc:MovieClip	=	ui.actorGroup.getItemByIndex(i);
				//				mc[TXT]		=	new NxLabel();
				mc[TXT].mouseEnabled	=false
				//				mc.addChild(mc[TXT]);
				mc[INDEX]	=	i;
			}
		}
		/**
		 *选择伙伴 
		 * @param e
		 * 
		 */		
		private function actorClickHandle(e:Event):void
		{
//			trace("ActorPropertyControl.actorClickHandle(e)",e.target);
//			currentSelected=proUI.actorGroup.geti
			if(currentSelectedM.contains(e.target as DisplayObject))return ;
			var mc:MovieClip=getMc();
			if(mc[INDEX]==0	||	mc[IS_FULL_DATA])
			{
				currentSelectedM=mc;
				var str:String = getPropertyFromNowList("FightPet");
				if(str==null ||str =="0"){
					ui.petMc.visible = false;
				} else {
					ui.petMc.visible = true;
				}
			}
			else
			{
	//			refreshIndex(currentSelectedM[DATA])
	//			refreshBlind();
	//			var name:String=mc[MC_NAME];
				var configid:int=mc[MC_CONFIG]
				lookOverPartner(configid)
			}
			function getMc():MovieClip
			{
				var len:int=ui.actorGroup.col*ui.actorGroup.row
				for (var i:int = 0; i < len; i++) 
				{
					var mc:MovieClip	=	ui.actorGroup.getItemByIndex(i);
					if(mc.contains(e.target as DisplayObject))
						return mc
				}
				return null
			}
			
		}
		public function set photo(value:String):void 
		{
			//			var url : String  = StageInfo.npcResPath + value + "_ani_0.swf";
			//			if( photoMc != null && url == actorVisual.name)
			//			{
			//				return;
			//			}
			var roleSkinIndex:int	=	0;
			var url:String	=	getUrl()
			url	=	ResPath.ACTORS + url;
			//			roleModel	=	ResPath.ACTORS + roleModel + value + ".swf";
			_ui.actorVisual.source =url
//			ResManager.loadResNoSave(url, url, onPhotoLoad,[url]);
			function getUrl():String
			{
				var head:String;
				var tails:String;
				if(currentSelectedM[INDEX]!=0)
				{
					head	=	"npc_";
					tails	=	".swf";
					setParentEuqePos();
				}
				else
				{
					setRoleEuqePos();
					roleSkinIndex	=	int(getPropertyFromNowList("ClotheModel"))//ModelLocator.getInstance().scene.Role.GetPropertiesEx("ClotheModel");
					roleSkinIndex	=	roleSkinIndex  == 0?1:roleSkinIndex;
					head	=	"role_";
					tails	=	"_"+roleSkinIndex+".swf";					
				}
				return head+value+tails;
			}
			
		}
		private function onPhotoLoad(val:DisplayObject,pList:Array):void
		{
			var url:String	=	pList[0];
			with (ui)
			{
				if(!val)
				{
//					trace("ActorPropertyLogic.photo(value)不存在？？？？",url,currentSelectedM[INDEX]);
					return ;
				}
				if( photoMc != null && pList[0] == photoMc.name)
					clearPhoto();
				photoMc = val as MovieClip;
				//				photoMc.scaleX = photoMc.scaleY =  Number(StaticIni.getIniVar("PlayerConfig", "roleScale"));
				if(photoMc.numChildren == 1 && photoMc.totalFrames == 1 )
				{
					photoMc = photoMc.getChildAt( 0 ) as MovieClip;
				}else
				{
					photoMc = ResManager.copy( photoMc ) as  MovieClip;
				}
				photoMc.gotoAndPlay(PlayerActionFlag.NormalWait);
				actorVisual.source = photoMc;
				actorVisual.name = pList[0];
				if(!actorVisual.parent)
				{
					windowBG.addChild(actorVisual);
				}
			}
		}
		private function clearPhoto():void
		{
			MemoryOptimise.stopMovie(ui.photoMc);
			ui.actorVisual.clear();
			ui.photoMc = null;
		}
		
		/**
		 *最大生命 
		 * @return 
		 * 
		 */		
		public function get maxLife():int 
		{ 
			return _maxLife; 
		}
		
		public function set maxLife(value:int):void
		{
//			value=GameDefine.GET_MAXHP(value)
			if (_maxLife == value)
				return;
			_maxLife = value;
			refreshLife();
		}
		
		
		/**
		 *当前生命 
		 * @return 
		 * 
		 */		
		public function get nowLife():int 
		{ 
			return _nowLife; 
		}
		
		
		public function set nowLife(value:int):void
		{
			if (_nowLife == value)
				return;
			_nowLife = value;
			refreshLife()
		}
		/**
		 *生命值刷新 
		 * 
		 */		
		private function refreshLife():void
		{
			ui.lifeTxT.htmlStrByBorder=StaticIni.getSwfLangStrVar("UIString_1000010",[/*nowLife+"/"+*/maxLife]);
		}
		
		public function get skill():int 
		{ 
			return _skill; 
		}
		
		public function set skill(value:int):void
		{
			if (_skill == value)
				return;
			_skill = value;
			ui.skillComb.setSelected(value);
			//				="招式："+value;
		}
		/**
		 *当前xml是不是  主角 
		 * @return 
		 * 
		 */		
		private function get currentXMLisRole():Boolean
		{
			if(_nowList is XML)
			return  _nowList.elements(PARTNER).toXMLString()
			return false;
		}
		public function get gang():int 
		{ 
			return _gang;
		}
		
		public function set gang(value:int):void
		{
//			if (_gang == value)
//				return;
			_gang = value;
			if(currentXMLisRole)
			{
				ui.gangTxT.htmlStrByBorder=StaticIni.getSwfLangStrVar("UIString_1000567",[GameDefine.PART_GANG(value)]);
			}
			else
			{
				ui.gangTxT.htmlStrByBorder=StaticIni.getSwfLangStrVar("UIString_1000011",[GameDefine.PART_PROFTYPE(value)]);
			}
			
			
		}
		
		public function get outWork():int 
		{ 
			return _outWork; 
		}
		
		public function set outWork(value:int):void
		{
			if (_outWork == value)
				return;
			_outWork = int(value);
			ui.outWorkTxT.htmlStrByBorder=StaticIni.getSwfLangStrVar("UIString_1000012",[value]);
		}
		
		
		public function get interWork():int 
		{
			return _interWork; 
		}
		
		public function set interWork(value:int):void
		{
			if (_interWork == value)
				return;
			_interWork = value;
			ui.interWorkTxT.htmlStrByBorder=StaticIni.getSwfLangStrVar("UIString_1000013",[value]);
		}
		/**
		 *体魄 
		 * @return 
		 * 
		 */		
		public function get staWork():int 
		{
			return _staWork; 
		}
		
		public function set staWork(value:int):void
		{
			if (_staWork == value)
				return;
			_staWork = int(value);
			ui.sta_lab.htmlStrByBorder=StaticIni.getSwfLangStrVar("UIString_1000014",[value]);
//			maxLife	=	GameDefine.GET_MAXHP(value);
		}
		
		/**
		 *等级 
		 * @return 
		 * 
		 */		
		public function get lvl():String 
		{
			return _lvl; 
		}
		
		public function set lvl(value:String):void
		{
			if (_lvl == value)
				return;
			_lvl = value;
			ui.lvlTxT.htmlStrByBorder=StaticIni.getSwfLangStrVar("UIString_1000015",[value]);
		}
		
		public function get maxExp():Number 
		{ 
			return _maxExp; 
		}
		
		public function set maxExp(value:Number):void
		{
			if (_maxExp == value)
				return;
			_maxExp = value;
			refreshExpBar()
		}
		
		public function get exp():Number 
		{ 
			return _exp; 
		}
		
		public function set exp(value:Number):void
		{
			if (_exp == value)
				return;
			_exp = value;
			refreshExpBar()
			
		}
		private function refreshExpBar():void
		{
			if(_maxExp)
			{
				(ui.expBar["loadingLine"] as MovieClip).width=Math.min(_exp/_maxExp,1)*(ui.expBar["loadingLineBack"].width-7);
			}
			else
			{
				(ui.expBar["loadingLine"] as MovieClip).width=0;
			}
			ui.expTxT.htmlStrByBorder=StaticIni.getSwfLangStrVar("UIString_1000016",[_exp+"/"+_maxExp]);
		}
		
		/**
		 *声望 
		 * @return 
		 * 
		 */		
		public function get reputation():int 
		{ 
			return _reputation;
		}
		
		public function set reputation(value:int):void
		{
			if (_reputation == value)
				return;
			_reputation = value;
			ui.reputationTxT.htmlStrByBorder=StaticIni.getSwfLangStrVar("UIString_1000017",[value]);
		}
		public function set skillid(id:int):void
		{
			var _skillName:String="";
			_skillName=StaticIni.getSwfLangStr(id+"");
			//			_text.htmlText=_skillName
			//			ui.skillComb.clear();
			//			ui.skillComb.addItem({label:_text.text,data:id});
			ui.skill_lab.htmlStrByBorder=_skillName;
		}
		
		/**
		 *战斗力 
		 * @return 
		 * 
		 */		
		public function get figthCount():int 
		{ 
			return _figthCount; 
		}
		
		public function set figthCount(value:int):void
		{
//			if (_figthCount == value)
//				return;
			_figthCount = value;
//			ui.fightCountTxT.htmlStrByBorder=StaticIni.getSwfLangStrVar("UIString_1000018",[value]);
			ui.fightCountTxT.htmlStrByBorder=StaticIni.getSwfLangStrVar("UIString_1000018",[value +int(_model.scene.Role.GetProperties("FightPetPower"))]);
		}
		/**
		 *人物名 
		 * @return 
		 * 
		 */		
		public function get actorName():String 
		{ 
			return _name;
		}
		
		public function set actorName(value:String):void
		{
			if (_name == value)
				return;
			_name = value;
			ui.nameTxT.htmlStrByBorder=value;
		}
		public function set configIId(ii:int):void
		{
			actorName	=	StaticIni.getSwfLangStr(ii+"")+"";
		}
		public function get ui():ActorPropertyUI
		{
			return  _ui;
		}
	
		
	}
}